Improved Graph-Based Lambda Lifting
نویسندگان
چکیده
Lambda lifting is a technique for transforming a program with local function definitions into a program consisting only of global function definitions. The best known lambda lifting algorithm computes the minimal set of extraneous parameters needed by each function in O(n) steps by solving a system of set equations which are recursive if the functions in the program are mutually recursive. Mutually recursive functions give rise to strongly connected components in the call graph of a program. Danvy and Schultz observed that all functions in a strongly connected component can be given the same set of free variables as extraneous parameters. Based on this observation, they developed an O(n) graph-based lambda lifting algorithm. This article illustrates how Danvy’s and Schultz’s algorithm is an approximation of Johnsson’s algorithm for a certain class of programs and describes an O(n) graph-based lambda lifting algorithm that yields the same results as Johnsson’s algorithm.
منابع مشابه
Lifting Infinite Normal Form Definitions From Term Rewriting to Term Graph Rewriting
Infinite normal forms are a way of giving semantics to non-terminating rewrite systems. The notion is a generalization of the Böhm tree in the lambda calculus. It was first introduced in [AB97] to provide semantics for a lambda calculus on terms with letrec. In that paper infinite normal forms were defined directly on the graph rewrite system. In [Blo01] the framework was improved by defining t...
متن کاملLambda - Dropping : Transforming Recursive Equations into Programswith Block
Lambda-lifting a functional program transforms it into a set of recursive equations. We present the symmetric transformation: lambda-dropping. Lambda-dropping a set of recur-sive equations restores block structure and lexical scope. For lack of scope, recursive equations must carry around all the parameters that any of their callees might possibly need. Both lambda-lifting and lambda-dropping t...
متن کاملA Modal-Logic Based Graph Abstraction
Infinite or very large state spaces often prohibit the successful verification of graph transformation systems. Abstract graph transformation is an approach that tackles this problem by abstracting graphs to abstract graphs of bounded size and by lifting application of productions to abstract graphs. In this work, we present a new framework of abstractions unifying and generalising existing tak...
متن کاملObstructions to Lifting Tropical Curves in Hypersurfaces
Tropicalization takes a curve in a hypersurface in 3-space to a balanced rational weighted graph in a tropical surface. In this paper, we study the ‘lifting’ problem: given a graph in a tropical surface, can one find a corresponding algebraic curve in a hypersurface? We develop specific combinatorial obstructions to a graph lifting by studying the factorizations of polynomials with particular N...
متن کاملLambda-Lifting in Quadratic Time
Lambda-lifting is a program transformation used in compilers and in partial evaluators and that operates in cubic time. In this article, we show how to reduce this complexity to quadratic time, and we present a flow-sensitive lambda-lifter that also works in quadratic time. Lambda-lifting transforms a block-structured program into a set of recursive equations, one for each local function in the...
متن کامل